<!DOCTYPE html>
<html>
  
  <head>
    <meta charset="UTF-8">
    <title>消防设备厂商信誉评估</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta http-equiv="Access-Control-Allow-Origin" content="*">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="./css/font.css">
    <link rel="stylesheet" href="./css/xadmin.css">
    <link rel="stylesheet" href="./css/com_table.css">
    
    <!--[if lt IE 9]>
      <script src="./lib/ie9/html5.min.js"></script>
      <script src="./lib/ie9/respond.min.js"></script>
    <![endif]-->
  </head>
  
  <body>
    <div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="javascript:;">诚信管理</a>
        <a href="javascript:;">消防设备厂商信誉评估</a>
      </span>
      <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
    </div>
    <div class="x-body">
      <div class="layui-row">
         <div class="fl comMarL">
            <!-- <a href="javascript:;" class="layui-btn" id="addperson">添加消防人员</a> -->
            <a href="javascript:;" class="layui-btn" id="export">导出</a>
         </div>
         <form class="layui-form fr comMarL" action="">
             <div class="layui-input-inline">
               <input type="text" name="title"   lay-verify="required" placeholder="" autocomplete="off" class="layui-input comInput" id="serMsg">
             </div>
             <div class="layui-input-inline">
                <a href="javascript:;" class="layui-btn" id="serBtn">搜索</a>
             </div>
             
         </form>
         
      </div>
      <table class="layui-hide" id="tableL" lay-filter="tableL">
      </table>
      <script type="text/html" id="barDemo">
        <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
        <a class="layui-btn layui-btn-xs" lay-event="del">删除</a>
      </script>

    </div>
    <script type="text/javascript" src="./js/jquery.min.js"></script>
    <script type="text/javascript" src="./js/config.js"></script>
    <script type="text/javascript" src="./lib/layui/layui.js"></script>
    <script type="text/javascript" src="./js/munu.js"></script>
    <script type="text/javascript" src="plugins/tableToExcel/tableToExcel.js"></script>
    <script type="text/javascript" src="./js/xadmin.js"></script>
    <script type="text/javascript">
      var hideMenu = [];
      var wData = {
          Command: "ReadPagingData",
          TableName: "DotBanks"
      };
      var url = './data/xfchangshangpg.json';
      var headArr = [
              {field:'id', title: '序号', sort: true},
              {field:'xm', title: '单位名称'},
              {field:'idn', title: '注册时间'},
              {field:'tel', title: '单位优良事件表彰'},
              {field:'jh', title: '不良事件记录'},
              {field:'sd', title: '设备故障报警次数'},
              {field:'jm', title: '批量检修次数'},
              {field:'zt', title: '设备故障重大事件'},
              {field:'st', title: '法人征信评级'},
              {field:'df', title: '单位综合分数'},
              {field:'dp', title: '单位评级'},
              {title: '附件',toolbar: '#barDemo'}
      ];
      layui.use(['table','laydate'], function(){
        $ = layui.jquery;
        var laydate = layui.laydate;
        var table = layui.table;
        //执行一个laydate实例
        laydate.render({
          elem: '#start' //指定元素
        });

        //执行一个laydate实例
        laydate.render({
          elem: '#end' //指定元素
        });

        /*************表格***************/
        
        var tab = renderTable(table,url,'#tableL',wData,headArr,function(res){
            $('[data-field=Id]').hide();
        });

        /*************表格***************/

        //修改跳转
        table.on('tool(tableL)', function(obj){
            var that  = this;
            var data = obj.data;
            if( obj.event === 'edit'){
                store.save('editData',data);
                window._EditFrameIndex = x_admin_show('修改网点','./sh-bank_edit.html');
            }else if( obj.event === 'del' ) {

                var delData = {
                     Command : 'DeleteDotBank',
                     Id : data.Id
                }

                reAjax(delData,function(res){
                   if( res.code == 0 ) {
                      layer.msg(res.msg);
                      $(that).closest('tr').remove();
                      if( IEVersion() ){ //ie
                             location.replace(location.href);
                      }
                      layui.table.reload("tableL");

                   }
                })
            }
        });

        /**************新增页面****************/
        $('#addBtn').click(function(){
           window._EditFrameIndex = x_admin_show('新增网点','./sh-bank_add.html');
        });

        /***************搜索*********************/
        $('#serBtn').click(function(){
           var allData = {
             '[ORFuzzy]BankName': $.trim($('#serMsg').val()),
             '[ORFuzzy]BankNo': $.trim($('#serMsg').val())
           }

           tabReload(tab,allData);
        })   
           
      });
    </script>
  </body>

</html>